module.exports = class {
  apply(compiler) {
    compiler.hooks.compilation.tap('pluginTest', compilation => {
      compilation.chunkTemplate.hooks.renderManifest.tap('pluginTest', (result, options) => {
        const newRes = [];
        result.forEach(res => {
          const { contentHashType, chunk } = res.pathOptions.chunk;
          const isNormalJsModule = true;
          if (contentHashType === 'javascript' && chunk.chunkReason.startsWith('split chunk')) {
            const modules = chunk._modules;
            if (!modules.every(_module => _module.type === 'css/mini-extract' || _module._source._value === '// extracted by mini-css-extract-plugin')) {
              isNormalJsModule = false;
            }
          }
          if (!isNormalJsModule) {
            newRes.push(res);
          }
        });
        return newRes;
      });
    });
  }
}